package gunbiao;
import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class Deserialization {
    public static void main(String[] args) {
       
        try {
            FileInputStream fileInputStream = new FileInputStream("D:/desktop/test.txt");//打开序列化文件
            
            ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);//反序列化
            
           Person gunbiao = (Person) objectInputStream.readObject();//读取文件
            
            System.out.println("反序列化成功");//用户提示
            
            System.out.println(gunbiao.toString());//输出反序列化后的结果
        
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
